package com.gy.smartmanagement.process.processdevice.fragment;

import android.os.Bundle;
import android.widget.EditText;
import com.gy.smartmanagement.R;
import com.gy.smartmanagement.base.fragment.BaseListFragment;
import com.gy.smartmanagement.process.processdevice.adapter.MaintenAdapter;
import com.gy.smartmanagement.process.processdevice.mvp.MaintenBean;

import java.util.ArrayList;
import java.util.List;

import androidx.recyclerview.widget.LinearLayoutManager;
import butterknife.BindView;
import tl.com.easy_recycleview_library.BaseRecyclerViewAdapter;

public class MaintenanceFragment extends BaseListFragment<MaintenBean> {

  @BindView(R.id.maintence_search_et)
  EditText maintence_search_et;


  public static final String TAG = "MaintenanceFragment";

  public static MaintenanceFragment newInstance() {

    Bundle args = new Bundle();

    MaintenanceFragment fragment = new MaintenanceFragment();
    fragment.setArguments(args);
    return fragment;
  }

  @Override
  public int getLayoutResId() {
    return R.layout.fragment_maintence;
  }

  @Override
  public void onUnBind() {

  }

  @Override
  protected void initView() {

    List<MaintenBean> maintenBeanList=new ArrayList<>();

    for (int i=0;i<10;i++){
      MaintenBean bean=new MaintenBean();
      bean.setName("test"+i);
      bean.setNumber(i+"");
      bean.setPerson("lilei");
      bean.setTime("2019-11-22");
      bean.setPosition("三航大厦");
      maintenBeanList.add(bean);
    }

    MaintenAdapter maintenAdapter=new MaintenAdapter(getContext(),maintenBeanList,R.layout.item_maintence);
    BaseRecyclerViewAdapter adapter=new BaseRecyclerViewAdapter(maintenAdapter);
    recycleView.setLayoutManager(new LinearLayoutManager(getContext()));
    recycleView.setAdapter(adapter);
    canLoadMore(false);
    canPull(false);
  }
}
